Repository navigation
fix(server-utils): Keep OpenAI decision confidence on Vercel AI decide spans - #25457
Conversation
size-limit report 📦Compared: 5242a78 (PR test merge using develop at a01cfca) Against: a01cfca (develop) · base run #62876 ✅ Baseline matches: this diff contains only this PR's changes.
|
| recordOutputs: true, | ||
| }, | ||
| result: { | ||
| answers: { department: { type: 'choice', value: 'billing' } }, |
There was a problem hiding this comment.
should this not be choice instead of value? https://github.com/vercel/ai/blob/main/packages/ai/src/decide/decision-result.ts#L9-L15
2d16764 to
9c59cf9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c59cf9. Configure here.
13bc41b to
b2b9dcd
Compare
| answers: { department: { type: 'choice', choice: 'billing' } }, | ||
| providerMetadata: { [provider]: { confidence: { department: 0.91 } } }, | ||
| }, | ||
| } as unknown as Message; |
There was a problem hiding this comment.
l: That might be better (same for the test which already existed)
| } as unknown as Message; | |
| } satisfies Message; |
There was a problem hiding this comment.
Good call, switched both tests to satisfies Message.
…e spans Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0285704 to
274aa37
Compare

What
Decide spans from Vercel AI
experimental_decidewithopenai.decisionModel()now keep the confidence of each answer.Why
The OpenAI provider moves confidence out of the answers into its provider metadata, so before this change Sentry lost it. TypeSafe models already kept it.